﻿CREATE PROCEDURE [dbo].[proc_Customer_Getlist_Count]
(
		@CompanyId int,
		@SourceId int,
		@TypeId int,
		@StateId int,
		@ProtectId int,
		@IndustryOneId int,
		@Stext nvarchar(50)
	)
AS
Begin
	Select Count(Id) From Customer
	Where (@CompanyId=0 Or CompanyId=@CompanyId) and (@SourceId=0 Or SourceId=@SourceId) and (@TypeId=0 Or TypeId=@TypeId) 
	and (@StateId=0 Or StateId=@StateId) and (@ProtectId=0 Or ProtectId=@ProtectId) and (@IndustryOneId=0 Or IndustryOneId=@IndustryOneId) and (@Stext is null Or CustomerName like '%'+@Stext+'%')
End
	RETURN
